'use strict';

define(['services'], function (services) {
    services.stat.register('StatService', ['$resource', function ($resource) {
        return $resource('/rest/stat/:id', {id: '@id'}, {
            findNodes: {
                url: '/rest/stat/nodes',
                method: 'GET',
                isArray: true
            },
            findCollections: {
                url: '/rest/solr/collection/query',
                method: 'GET',
                params: {available: true},
                isArray: true
            },
            findReplicas: {
                url: '/rest/stat/replicas',
                method: 'GET',
                isArray: true
            },
            getQpsStat: {
                url: '/rest/stat/qps',
                method: 'GET',
                isArray: false
            },
            getVisitStat: {
                url: '/rest/stat/visit',
                method: 'GET',
                isArray: false
            },
            getLoadStat: {
                url: '/rest/stat/load',
                method: 'GET',
                isArray: false
            },
            getGrowStat: {
                url: '/rest/stat/grow',
                method: 'GET',
                isArray: false
            },
            getStatusStat: {
                url: '/rest/stat/status',
                method: 'GET',
                isArray: false
            },
            getCacheStat: {
                url: '/rest/stat/cache',
                method: 'GET',
                isArray: false
            },
            getMemusageStat: {
                url: '/rest/stat/memusage',
                method: 'GET',
                isArray: false
            }
        });
    }]);
});